/*
 * Copyright (c) 2009 Robert Esser
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package net.e2ser.token;

import java.util.ArrayList;

/**
 *
 * <p>Title: Petri Net Editor/Simulator</p>
 * <p>Description: A store for token objects</p>
 * <p>Copyright: Copyright (c) 2009</p>
 * <p>Company: </p>
 * @author Rob Esser
 * @version 1.0
 */
public class TokenStore {
  // represents a store of tokens and is always associated with a place
  ArrayList<Token> tokens;

  public TokenStore() {
    // create an empty store
    tokens = new ArrayList<Token>();
  }

  public int size() {
    // return the number of tokens
    return tokens.size();
  }

  public void addToken(Token tok) {
    // add a token
    tokens.add(tok);
  }

  public void removeToken() {
    // remove a token
    if (this.size() > 0) {
      tokens.remove(0);
    }
  }

}
